package com.lenovo.smarttraffic.ui.activity;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.lenovo.smarttraffic.MainActivity;
import com.lenovo.smarttraffic.R;

/**
 * Created by Caleb.F
 * on 2019-11-24
 * at 23:39
 */
public class SettingActivity extends BaseActivity {
        private ImageView mIvETCAccout;
        private TextView mTvETCAccout;
        private ImageView mIvUserPer;
        private ImageView mIvETCRecord;
        private ImageView mIvVersion;
        private TextView mTvUserPer;
        private TextView mTvETCRecord;
        private TextView mTvETCVersion;
        private Button mBtnExit;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        initView();
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_settings;
    }


    private void initView() {
        initToolBar("设置");
        mIvETCAccout = findViewById(R.id.iv_ETC_Accout);
        mTvETCAccout = findViewById(R.id.tv_ETC_Accout);
        mIvUserPer = findViewById(R.id.iv_User_per);
        mIvETCRecord = findViewById(R.id.iv_ETC_Record);
        mIvVersion = findViewById(R.id.iv_version);
        mTvUserPer = findViewById(R.id.tv_User_per);
        mTvETCRecord = findViewById(R.id.tv_ETC_Record);
        mTvETCVersion = findViewById(R.id.tv_ETC_version);
        mBtnExit = findViewById(R.id.btn_exit);
        if(!MainActivity.isLogin()) {
            mBtnExit.setBackgroundResource(R.drawable.btn_exit_false);
            mBtnExit.setEnabled(false);
        }
        mBtnExit.setOnClickListener(v->{
            MainActivity.setIsLogin(false);
            finish();
        });
    }


}
